package com.four.basicinfo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.four.basicinfo.entity.Abroad;
import com.four.basicinfo.entity.Migrate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MigrateDao extends BaseMapper<Migrate> {
    /**
     * 查询移居
     *
     * @param id 移居主键
     * @return 移居
     */
    public Migrate selectMigrateById(Long id);
    //查询个人
    @Select("select id, number, name, relationship, identity, country, city, " +
            "document_num as documentNum, migrate_type as migrateType, migrate_date as migrateDate, notes from migrate where number=#{number}")
    public List<Migrate> selectByNum(Integer number);

    /**
     * 新增移居
     *
     * @param migrate 移居
     * @return 结果
     */
    public int insertMigrate(Migrate migrate);

    /**
     * 修改移居
     *
     * @param migrate 移居
     * @return 结果
     */
    public int updateMigrate(Migrate migrate);

    /**
     * 删除移居
     *
     * @param id 移居主键
     * @return 结果
     */
    public int deleteMigrateById(Long id);
}
